home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Snippets / Toolbox / DateThing / DateThing.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-08-05  |  2.8 KB  |  90 lines  |  [TEXT/MPS ]

  1. #include <Types.h>
  2. #include <memory.h>
  3. #include <Packages.h>
  4. #include <Errors.h>
  5. #include <quickdraw.h>
  6. #include <fonts.h>
  7. #include <dialogs.h>
  8. #include <windows.h>
  9. #include <menus.h>
  10. #include <events.h>
  11. #include <OSEvents.h>
  12. #include <Desk.h>
  13. #include <diskinit.h>
  14. #include <OSUtils.h>
  15. #include <resources.h>
  16. #include <toolutils.h>
  17. #include <AppleEvents.h>
  18. #include <EPPC.h>
  19. #include <GestaltEqu.h>
  20. #include <PPCToolbox.h> 
  21. #include <Processes.h>
  22. #include <Balloons.h>
  23. #include <aliases.h>
  24.  
  25. typedef void (*myDrawProcPtr)(WindowPtr theWindow); 
  26. typedef void (*myClickProcPtr)(WindowPtr theWindow,EventRecord *theEvent); 
  27. typedef void (*windowSaveProc)(WindowPtr theWindow); 
  28. typedef void (*myCloseProcPtr)(WindowPtr theWindow); 
  29. typedef void (*mySizeProcPtr)(WindowPtr theWindow,short how); 
  30. typedef void (*myActivateProcPtr)(WindowPtr theWindow,Boolean active); 
  31.  
  32. /* windowControl is the structure attached to every window I create (in the refCon */
  33. /* field) that contains all the information I need to know about the window. */
  34. /* data, procedure pointers for controlling, and anything else gets put in this */
  35. /* struct.  That makes my windows autonomous */
  36. struct windowControl {
  37.     unsigned long windowID;                                 /* master ID number  */
  38.     myDrawProcPtr drawMe;                                         /* content drawing procedure pointer */
  39.     myClickProcPtr clickMe;                                        /* content click routine */
  40.     myCloseProcPtr closeMe;                                        /* document close procedure pointer */
  41.     mySizeProcPtr sizeMe;                                            /* size procedure */
  42.     myActivateProcPtr activateMe;
  43.     AliasHandle fileAliasHandle;                            /* alias for this document */
  44.     Boolean windowDirty;
  45.     Handle generalData;                                        /* cast to whatever you need as you need it */
  46. };
  47. typedef struct windowControl windowControl, *windowCPtr, **windowCHandle;
  48.  
  49. struct AEinstalls {
  50.     AEEventClass theClass;
  51.     AEEventID theEvent;
  52.     EventHandlerProcPtr theProc;
  53. };
  54. typedef struct AEinstalls AEinstalls;
  55.  
  56. enum {kDocWindowResID = 128,kMyDocumentWindow = 1000};
  57. /* menu enums */
  58. enum {kMBarID = 128};
  59. enum {kAppleMenu = 128,kFileMenu,kEditMenu,kToolsMenu};
  60.  
  61. /* file menu enums */
  62. enum {kNewItem = 1,kOpenItem,kCloseItem,kSaveItem,kSaveAsItem,kFileBlank1,kPageSetupItem,kPrintItem,kFileBlank2,kQuitItem};
  63.  
  64. /* general purpose enums */
  65. enum {kResumeMask=1,kSampHelp=129,kAboutBox=128,kHelpString=128,kBadSystem=130};
  66.  
  67. enum {kMinHeight = 200};
  68.  
  69. enum {kGeneralStrings = 128};
  70. enum {kblankstring1=1,kkblankstring2,kblankstring3,kblankstring4,kDadWords,kToWord};
  71.  
  72. enum {
  73.     kHomeKey = 1,
  74.     kEnterKey = 0x3,
  75.     kHelpKey = 5,
  76.     kDeleteKey = 8,
  77.     kTabKey = 9,
  78.     kPageUpKey = 0x0b,
  79.     kPageDownKey,
  80.     kReturnKey = 0x0d,
  81.     kEscKey = 0x1B,
  82.     kLeftArrowKey,
  83.     kRightArrowKey,
  84.     kUpArrowKey,
  85.     kDownArrowKey,
  86.     kSpaceKey,
  87.     kFDeleteKey = 0x7f, 
  88.  
  89.     };
  90. enum {kDateDialog = 130};